home *** CD-ROM | disk | FTP | other *** search
/ Dr. Windows 3 / dr win3.zip / dr win3 / PROGRAMR / CENVIW2.ZIP / MSGBOXES.CMM < prev    next >
Text File  |  1993-09-13  |  1KB  |  30 lines

  1. /*************************************************************
  2.  *** MsgBoxes - Sample Cmm code to demonstrate uses of the ***
  3.  ***            MessageBox() function.                     ***
  4.  *************************************************************/
  5. #include <MsgBox.lib>
  6.  
  7. MessageBox("The following samples show various ways\n"
  8.            "to use the Windows MessageBox() function.\n"
  9.            "A wrapper for MessageBox() is located in\n"
  10.            "the Cmm library: \"MsgBox.lib\"",
  11.            "MsgBoxes - Welcome!");
  12.  
  13. MessageBox("This example only passes 1 parameter: the message string.");
  14.  
  15. MessageBox("This passes the message string and a title.","Here is the title.");
  16.  
  17. MessageBox("This example passes a zero-length string to get no title.","");
  18.  
  19. switch ( MessageBox("You can also offer different choices.\nPick one now...",
  20.                     "MessageBox() choices",
  21.                     MB_YESNOCANCEL) ) {
  22.    case IDYES:    button = "Yes";   break;
  23.    case IDNO:     button = "No";    break;
  24.    case IDCANCEL: button = "Cancel";   break;
  25. }
  26.  
  27. sprintf(message,"You selected the %s button",button);
  28. MessageBox(message,"");
  29.            
  30.